package Calculation;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int a =0;
        int b =0;
        Calculation main = new Calculation();
        System.out.println("please choose your calculation");
        Scanner scanner = new Scanner(System.in);
        if (scanner.hasNextLine()){

            String method = scanner.nextLine();
            if (method.equals("add")){
                int result = main.add(a,b);
                System.out.println(result);
            }
            if (method.equals("subtract")) {
                int result = main.substract(a,b);
                System.out.println(result);
            }
            if (method.equals("multiply")) {
                int result = main.multiply(a,b);
                System.out.println(result);
            }
            if (method.equals("divide")){
                if (b == 0){
                    System.out.println("0不能当除数");
                }
                else{double result =main.divide(a,b);
                    System.out.println(result);}
            }
            if (method.equals("involution")){
                double result =main.involution(a,b);
                System.out.println(result);
            }


        }

        }

    }


